#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cstring>
#define endl "\n"
using namespace std;
int main()
{
	long long t,n,mun=0,a;
	cin>>t;
	while(t--)
	{
		cin>>n;
		mun=0;
		while(n--)
		{
			cin>>a;
			mun+=a;
		}
		a=sqrt(mun);
		if(a*a==mun)
		{
			cout<<"YES"<<endl;
		}
		else
		cout<<"NO"<<endl;
	}
	return 0;
}